package cn.gameo2o.service.hdgl.impl;

import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.gameo2o.dao.hdgl.HuoDongGuanLiDAO;
import cn.gameo2o.pojo.O2o_play;
import cn.gameo2o.service.hdgl.HuoDongGuanLiService;
import cn.gameo2o.util.PageParam;

/**
 * 活动管理service实现
 * @author 黄伟华
 *
 */
@Service
public class HuoDongGuanLiServiceImpl implements HuoDongGuanLiService {
	@Autowired
	private HuoDongGuanLiDAO hdgldao;

	public int addHD(O2o_play p) {
		// TODO Auto-generated method stub
		return hdgldao.addHD(p);
	}

	public List<O2o_play> findHD(Map<String, Object> params, PageParam page) {
		// TODO Auto-generated method stub
		Long count = hdgldao.count(params);
        page.setTotal(count);
        page.setRows(hdgldao.findHD(params,page.getFirst(),page.getPageSize()));
        return hdgldao.findHD(params, page.getFirst(), page.getPageSize());
	}

	public O2o_play findById(Integer id) {
		// TODO Auto-generated method stub
		return hdgldao.findById(id);
	}

	public int updateHD(O2o_play p) {
		// TODO Auto-generated method stub
		return hdgldao.updateHD(p);
	}

	public int deleteHD(Integer id) {
		// TODO Auto-generated method stub
		return hdgldao.deleteHD(id);
	}
}
